package com.indexingsystem.system.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.indexingsystem.boss.admin.mapper.RuleLogsMapper;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.RuleLogs;
import com.indexingsystem.boss.utils.BeanUtils;
import com.indexingsystem.system.service.IRuleLogsService;

@Service
public class RuleLogsServiceImpl implements IRuleLogsService{

	@Resource
	private RuleLogsMapper ruleLogsMapper;
	@Override
	public int deleteByPrimaryKey(String ruleLogId) {
		return ruleLogsMapper.deleteByPrimaryKey(ruleLogId);
	}

	@Override
	public int insertSelective(RuleLogs record) {
		return ruleLogsMapper.insertSelective(record);
	}

	@Override
	public RuleLogs selectByPrimaryKey(String ruleLogId) {
		return ruleLogsMapper.selectByPrimaryKey(ruleLogId);
	}

	@Override
	public int updateByPrimaryKeySelective(RuleLogs record) {
		return ruleLogsMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public PagedResult<RuleLogs> selectRuleLogsList(Integer pageNo, Integer pageSize) {
		pageNo = pageNo == null?1:pageNo;
		pageSize = pageSize == null?10:pageSize;
		//startPage是告诉拦截器说我要开始分页了。分页参数是这两个。
		PageHelper.startPage(pageNo,pageSize);  
		return BeanUtils.toPagedResult(ruleLogsMapper.selectRuleLogsList());
	}
}